import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		add: null,
		tags: null,
		salary: null, //薪资待遇 字典
		xeuli: null, // 学历 字典
		jingyan: null, //经验 字典
		industry: null, //行业 字典
		qiuzhi: null, //求职状态 字典
		nianling: null, //年龄 字典
		leixing: null, //求职类型 字典
		zhaopinlx: null, //招聘类型 字典
		hours: null, //上班时间 字典
		holiday: null, //工作假期 字典
		screeningData: null, // 筛选参数
		upData: 1,
		conversationList: [], //聊天列表
		videoInterview: false,
		liveMessage: {}, //直播信息
		activation: 3, //首页顶部tab切换
		jobAdd: null, //求职端筛选
		tags: [], //在线简历能力标签
		AddAddressManually: [], //发布职位时自己添加的地址
	},
	getters: {
		setconversationListGetter: (state) => {
			return state.conversationList
		}
	},
	mutations: {
		//发布职位时自己添加的地址
		setAddAddressManually(state, val) {
			state.AddAddressManually = val
		},
		//修改在线简历能力标签
		setTags(state, val) {
			state.tags = val
		},
		setLiveMessage(state, val) {
			state.liveMessage = val
		},
		setVideoInterview(state, val) {
			state.videoInterview = val
		},
		//相当于同步的操作
		setAdd(state, val) { //存储筛选的条件的值
			state.add = val
		},
		// 存储招聘筛选学历的值
		setTags(state, val) {
			state.tags = val
		},

		setSalary(state, val) {
			state.salary = val
		},
		setXeuli(state, val) {
			state.xeuli = val
		},
		setJingyan(state, val) {
			state.jingyan = val
		},
		setIndustry(state, val) {
			state.industry = val
		},
		setQiuzhi(state, val) {
			state.qiuzhi = val
		},
		setNianling(state, val) {
			state.nianling = val
		},
		setLeixing(state, val) {
			state.leixing = val
		},
		setZhaopinlx(state, val) {
			state.zhaopinlx = val
		},
		setHours(state, val) {
			state.hours = val
		},
		setHoliday(state, val) {
			state.holiday = val
		},

		setScreeningData(state, val) {
			state.screeningData = val
		},

		setUpData(state, val) {
			state.upData = val
		},

		setconversationList(state, val) {
			state.conversationList = val
		},
		setactivation(state, val) {
			state.activation = val
		},
		setjobAdd(state, val) { //求职者 存储筛选的条件的值
			state.jobAdd = val
		},



	},
	actions: {
		//相当于异步的操作,不能直接改变state的值，只能通过触发mutations的方法才能改变
	},
	modules: {}
})
export default store